<!doctype html>
<html lang="{idioma_js}">
    <head>
        <title>CMS 2.0+ | {titulo} | Link Nacional</title>
        {include_header_view}
        <script>
            $(window).load(function(){
                $('.usuarios tbody tr td a.acao').click(function(a){
                    a.preventDefault();
                    var obj = this;
                    var id = $(this).attr('id');
                    var tipo = $(this).attr('tipo');
                    var value = $(this).attr('value');
                    $.ajax({
                        url: base_cms+"user/user/"+tipo,
                        type: "POST",
                        data: {
                            'id' : id,
                            'value' : value
                        },
                        dataType: "json",
                        beforeSend: function(){
                            $(obj).addClass('load');
                        },
                        success: function(data) {
                            if(data.cod == 999){
                                $(obj).attr('value',data.status).attr('title',data.title).text(data.title);
                            } 
                            $(obj).removeClass('load');
                            $.msg(data.msg,{header:data.header,live:10000});
                        }
                    });
                });
            });    
        </script>
    </head>
    <body>

        {include_body_header_view}
        {include_body_menu_left_view}


        <section id="content">

            <div class="g12 nodrop">
                <h1>{titulo}</h1>
                <p>{descricao_titulo}</p>
            </div>	
            <div class="g12 widgets">
                <div id="widget_tabs">
                    <!--h3 class="handle">{titulo}</h3-->
                    <table class="documentation usuarios">
                        <thead>
                            <tr>
                                <th>{lang_username}</th>
                                <th>{lang_user_type_id}</th>
                                <th>{lang_email}</th>
                                <th>{lang_action}</th>
                            </tr>

                        </thead>
                        <tbody>
                            {usuarios}
                            <tr>
                                <td>{username}</td>
                                <td>{department}</td>
                                <td>{email}</td>
                                <td>
                                    <a title="{l_activated}" tipo="activated" id="{id}" value="{activated}" class="btn small acao">{l_activated}</a>
                                    <a title="{lang_change}" href="{base_cms}{link_user_change}/{id}" class="btn small">{lang_change}</a>
                                    <a title="{lang_permission}" href="{base_cms}{link_user_permission}/{id}" class="btn small">{lang_permission}</a>
                                </td>
                            </tr>
                            {/usuarios}
                        </tbody>
                    </table>
                </div>


            </div>
        </section>
        <footer>
            {include_footer_view}
        </footer>
    </body>
</html>